package gameFrame;

import java.awt.*;

public class Explode {
    double x,y;
    static Image[] img = new Image[16];
    static {
        for (int i =0;i<16;i++){
            img[i] =GameUtil02.getImage("images01/explode/e"+(i+1)+".gif");
            //懒加载  调用方法
            img[i].getWidth(null);
        }
    }
    int count;
    boolean live = true;
    public void draw(Graphics g){
        if(!live){
            return;
        }
        if(count <16){
            g.drawImage(img[count],(int)x,(int)y,null );
            count++;
        }else {
            live = false;
        }
    }

    public Explode(double x, double y) {
        this.x = x;
        this.y = y;
    }
}
